home *** CD-ROM | disk | FTP | other *** search
- //WISELOG("[yahooclassic.js] >>>>>");
- window.addEventListener("load",function(event){yahoosig.pageload(event)},true);
- window.addEventListener("unload",function(event){yahoosig.uninitView(event)},true);
-
- var yahoosig =
- {
- current: null,
- pageload: function (event)
- {
- try
- {
- wisestampsig.refreshCallback = yahoosig.refreshSignature;
- setTimeout(function ()
- {
- yahoosig.setupCompose();
- },
- 0);
- } catch(e)
- {
- // WISELOG(e);
- }
- },
- uninitView: function ()
- {
- if (this.current && this["uninit" + this.current])
- {
- this["uninit" + this.current]();
- }
- },
- setupCompose: function ()
- {
- yahoosig.addWisestampIcon();
- var iframes = evaluateXPath(document, "//iframe[@id='compose_editorArea']");
- if (iframes && iframes.length > 0)
- {
- for (var i = 0; i < iframes.length; i++)
- yahoosig.insertSignature(iframes[i]);
- }
- },
- addWisestampIcon: function ()
- {
- if (wisestampsig.showButton)
- {
- var iconPos = 510;
- var cont = document.getElementById("compose_palette"); //.parentNode;
- //style="" title="Underline" href="#Underline"/>
-
- //var editor = document.getElementById("compose_editorArea");
- //var newWidth = 650;
- //cont.setAttribute("style",cont.getAttribute("style")+" width: "+newWidth+"px;");
- //editor.setAttribute("style",editor.getAttribute("style")+" width: "+newWidth+"px;");
- //iconPos = 540;
-
- var a = document.createElement("a");
- a.setAttribute("class", "DhtmlButtonText");
- a.setAttribute("style", "position: absolute; top: 4px; display: block; width: 26px; height: 20px; background-image: url(" + wisestampsig.icon + "); background-position: 5px 3px; background-repeat: no-repeat; left: "+iconPos+"px;");
- a.setAttribute("title", "#href=WiseStamp")
- cont.appendChild(a);
- wisestampsig.initOptionsIcon(a);
- //var img = document.createElement("img");
- //img.setAttribute("src",wisestampsig.icon);
- //img.setAttribute("width","16");
- //img.setAttribute("height","16");
- //img.setAttribute("class","wisestampIcon");
- //img.setAttribute("style","vertical-align: middle; margin-left: 10px");
- //var button = img;
- //cont.appendChild(button);
- //wisestampsig.initOptionsIcon(button);
- }
- },
- uninitCompose: function ()
- {
-
- },
- iframeTries: 1,
- refreshSignature: function ()
- {
- wisestampsig.insertSignature(yahoosig.iframe, false);
- },
- insertSignature: function (iframe)
- {
- this.iframe = iframe;
- this.iframe.addEventListener('load', yahoosig.iframeLoad, false);
- this.iframeLoad(false);
- },
- iframeLoad: function (event)
- {
- setTimeout(function ()
- {
- wisestampsig.insertSignature(yahoosig.iframe, true);
- if (event)
- {
- try
- {
- yahoosig.iframe.removeEventListener('load', yahoosig.iframeLoad, false);
- } catch(e)
- {}
- }
- },
- !event ? 500 : 100);
- }
- };